import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);

export default new Vuex.Store({
  getters: {},

  modules: {},

  state: {
    // 定义全局状态，例如用户信息、登录状态等
    userInfo: null,
    isLoggedIn: false,
  },
  mutations: {
    // 定义改变状态的方法，例如设置用户信息和登录状态
    setUserInfo(state, userInfo) {
      state.userInfo = userInfo;
      state.isLoggedIn = true;
    },
  },
  actions: {},
});
